<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require_once(APPPATH .'models/super_model'. EXT);

class User_model extends Super_model {
	
	function __construct()
	{
		parent::__construct(USERS .' u', 'user_id');
	}

        function get_fullname() {

            $user_id = _session('user_id');
            $user_id = ( empty($user_id) ) ? 0 : $user_id;

            $data = $this->get_record(array(
                'where' => 'u.user_id = '.$user_id
            ));

            if ( empty($data) ) {
                $fullname = '';
            }
            else {
                $fullname = ucfirst($data['fname']) .' '.ucfirst($data['mname']). ' '.ucfirst($data['lname']);
            }

            return $fullname;

        }
}
/* End of file users_model.php */
/* Location: ./application/models/user_model.php */
